﻿using Abp.Timing;
using AVIS.OutBound.JiaZhao.Dto;
using AVIS.OutBound.Notify;
using AVIS.OutBound.UserAuth.Dto;
using AVIS.OutBound.WizardAgent.Helpers;
using Microsoft.International.Converters.PinYinConverter;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;

namespace AVIS.OutBound.UserAuth
{
    /// <summary>
    /// 用户校验的应用服务类
    /// </summary>
    public class UserAuthAppService : OutBoundAppServiceBase, IUserAuthAppService
    {
        #region 构造函数
        private readonly INotifyManager _notifyManager;

        public UserAuthAppService(
            NotifyManager notifyManager)
        {
            _notifyManager = notifyManager;
        }
        #endregion

        #region 属性
        private const String KeyPrefix = "SMS_";
        #endregion

        /// <summary>
        /// 帐号密码校验
        /// </summary>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        bool IUserAuthAppService.AuthByPassword(UserAuthByPasswordInput input)
        {

            return true;
        }

        /// <summary>
        /// 手机登录校验
        /// </summary>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        bool IUserAuthAppService.AuthByPhone(UserAuthByPhoneInput input)
        {
            if (RedisHelper.KeyExists(KeyPrefix + input.PhoneNumber))
            {
                return true;
            }

            return false;
        }
    }
}
